package com.zw.stock_sell_storage.controller;

import com.zw.stock_sell_storage.utils.FileUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/upload")
public class UploadController {

    @RequestMapping("/uploadImg")
    public String uploadImg(@RequestParam("file") MultipartFile file) throws IOException {
        String newFileName = FileUtils.uploadFileAb(file);
        return newFileName;
    }
}
